package com.rc.saas.mini.service.tenant;

import com.rc.saas.mini.common.base.TResponse;
import com.rc.saas.mini.mapper.tenant.TenantCooperationMapper;
import com.rc.saas.mini.model.member.MemberInfo;
import com.rc.saas.mini.model.tenant.TenantCooperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @author wangzhengwei
 * @create 2021/9/13
 */
@Service
public class TenantCooperationServiceImpl implements TenantCooperationService {
    @Autowired
    private TenantCooperationMapper tenantCooperationMapper;

    @Override
    public TenantCooperationMapper getMapper() {
        return tenantCooperationMapper;
    }

    @Override
    public TResponse saveTenantCooperation(TenantCooperation cooperation) {
        if (cooperation.getCreatedTime() == null) {
            cooperation.setCreatedTime(new Date());
        }
        this.insertSelective(cooperation);
        return TResponse.SUCCESS();
    }
}
